package com.chen.project.white_jotter.controller;


import com.chen.project.white_jotter.pojo.AdminMenu;
import com.chen.project.white_jotter.result.Result;
import com.chen.project.white_jotter.service.admin.MenuService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/api/admin")
public class AdminMenuController {

    @Resource
    private MenuService menuService;

    @GetMapping("/menus")
    public Result menu() {
        List<AdminMenu> menuList = menuService.getMenuListByCurrentUser();
        return new Result(200,"获取菜单成功", menuList);
    }
}
